<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>核损信息表</title>
    <t:base type="jquery"></t:base>
  <script type="text/javascript">
  function toPrice(s,n){
		n = n > 0 && n <= 20 ? n : 2;
		s = parseFloat((s.toString()).replace(/[^\d\.-]/g, "")).toFixed(n).toString();
		var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
		t = "";
		for (i = 0; i < l.length; i++) {
		t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
		}
		return t.split("").reverse().join("") + "." + r+" "+"元"; 
	}
  </script>
  
 <style type="text/css">
 	td {
	 border: 1px solid black;
	 height: 30px;
	 width:130px;
	  text-align:center;
	  word-wrap:break-word;/* 内容自动换行 */
	}
	table {
	width: 700px;
	table-layout:fixed ; /* 固定长度 */
	}
 </style>
 </head>
 <body>
 	
		<div style="color:red;"><strong>基本信息</strong></div>
		<table >
				<tr>
					<td  >案件流水号：</td>
					<td  >${baseInfo.reportNo }</td>
					
					<td  >牌号：</td>
					<td >${baseInfo.carNo }</td>
				</tr>
				
				<tr>
					<td >驾驶员：</td>
					<td>${baseInfo.driverNme }</td>
					
					<td >联系电话：</td>
					<td>${baseInfo.phone }</td>
				</tr>
				
				<tr>
					<td >车辆种类：</td>
					<td>${baseInfo.carType }</td>
					
					
				</tr>
				
		
			<table >
			<div style="color:red;"><strong>车辆基本信息</strong></div>
				<tr>
					<td > 车辆品牌：</td>
					<td >${carBaseInfo.vehbrandname }</td>
					
					<td >车系：</td>
					<td >${carBaseInfo.vehseriname }</td>
				</tr>
				
				<tr>
					<td >车组：</td>
					<td>${carBaseInfo.vehgroupname }</td>
					
					<td >车型：</td>
					<td>${carBaseInfo.vehcertainname }</td>
				</tr>
				
				<tr>
					<td >厂家名称：</td>
					<td>${carBaseInfo.vehfactoryname }</td>
				</tr>
			</table>
			
			
			<table >
			<div style="color:red;"><strong>修理厂信息</strong></div>
				<tr>
					<td >修理厂类别：</td>
					<td >${carBaseInfo.repairkindname }</td>
					
					<td >所属区域：</td>
					<td >${carBaseInfo.qyzdname }</td>
				</tr>
				
				
				<tr>
					<td >系数（工时）：</td>
					<td>${carBaseInfo.factorydict }</td>
				</tr>
			</table>
			
			<table >
			<div style="color:red;"><strong>配件信息</strong></div>
			
				<tr>
					<td >序号</td>
					<td >换件名称</td>
					<td >单价</td>
					<td >数量</td>
					<td >小计</td>
				</tr>
				<c:forEach items="${partInfoList }" var="part" varStatus="i">
					<tr>
					<td >${i.count }</td>
					<td >${part.partstandard }</td>
					<td id="lossprice${i.count }" >${part.lossprice}</td>
					<td >${part.losscount}</td>
					<td id="sumprice${i.count }" >${part.sumprice }</td>
					
					<script type="text/javascript">
						 $(function(){
  				   
				  				var a=0;
					 		    a=$("#lossprice${i.count }").html();
								 var loss=toPrice(a,2);
						 		$("#lossprice${i.count }").html(loss);
						 		
						 		var b=0;
					 		    b=$("#sumprice${i.count }").html();
								 var l=toPrice(b,2);
						 		$("#sumprice${i.count }").html(l);
						 	
		 		        });
						 </script>
					</tr>
				</c:forEach>
				
				
			</table>
			
			<table >
			<div style="color:red;"><strong>工时信息</strong></div>
			
				<tr>
					<td >序号</td>
					<td >修理名称</td>
					<td >工种</td>
					<td >工时费</td>
					<td >小计</td>
				</tr>
				<c:forEach items="${repairInfoList }" var="rep" varStatus="i">
					<tr>
					<td>${i.count }</td>
					<td >${rep.repairitemname }</td>
					<td >${rep.repairname}</td>
					<td id="unitmanhourprice${i.count }" >${rep.unitmanhourprice}</td>
					<td id="repairfee${i.count }" >${rep.repairfee }</td>
					
					<script type="text/javascript">
						 $(function(){
  				   
				  				var a=0;
					 		    a=$("#repairfee${i.count }").html();
								 var loss=toPrice(a,2);
						 		$("#repairfee${i.count }").html(loss);
						 		
						 		var b=0;
					 		    b=$("#unitmanhourprice${i.count }").html();
								 var l=toPrice(b,2);
						 		$("#unitmanhourprice${i.count }").html(l);
						 	
		 		        });
						 </script>
					</tr>
				</c:forEach>
			</table>
			
			<table >
			<div style="color:red;"><strong>辅料信息</strong></div>
			
				<tr>
					<td >序号</td>
					<td >辅料名称</td>
					<td >单价</td>
					<td >数量</td>
					<td >小计</td>
				</tr>
				<c:forEach items="${assisInfoList }" var="ass" varStatus="i">
					<tr>
					<td>${i.count }</td>
					<td >${ass.materialname }</td>
					<td id="unitprice${i.count }" >${ass.unitprice}</td>
					<td  >${ass.count}</td>
					<td id="materialfee${i.count }" >${ass.materialfee}</td>
					
					<script type="text/javascript">
						 $(function(){
  				   
				  				var a=0;
					 		    a=$("#materialfee${i.count }").html();
								 var loss=toPrice(a,2);
						 		$("#materialfee${i.count }").html(loss);
						 		
						 		var b=0;
					 		    b=$("#unitprice${i.count }").html();
								 var l=toPrice(b,2);
						 		$("#unitprice${i.count }").html(l);
						 	
		 		        });
						 </script>
					</tr>
				</c:forEach>
			</table>
			
			<table >
			<div style="color:red;"><strong>合计信息</strong></div>
				<tr>
					<td > 配件合计：</td>
					<td id="sumchgcompfee"  >${carBaseInfo.sumchgcompfee }</td>
					
					<td >工时合计：</td>
					<td id="sumrepairfee"  >${carBaseInfo.sumrepairfee }</td>
				</tr>
				
				<tr>
					<td >辅料合计：</td>
					<td id="summaterialfee" >${carBaseInfo.summaterialfee }</td>
					
					<td >残值合计：</td>
					<td id="sumRemnant" >${carBaseInfo.sumRemnant }  </td>
				</tr>
				
				<tr>
					<td >定损合计：</td>
					<td id="sumlossfee" >${carBaseInfo.sumlossfee }</td>
				</tr>
				<tr>
					<td >备注：</td>
					<td id="sumlossfee" colspan="3" >${carBaseInfo.remark }</td>
				</tr>
				<script type="text/javascript">
						 $(function(){
  				   
				  				var a=0;
					 		    a=$("#sumchgcompfee").html();
								 var loss=toPrice(a,2);
						 		$("#sumchgcompfee").html(loss);
						 		
						 		var b=0;
					 		    b=$("#sumrepairfee").html();
								 var l=toPrice(b,2);
						 		$("#sumrepairfee").html(l);
						 		
						 		var c=0;
					 		   	c=$("#summaterialfee").html();
								 var ll=toPrice(c,2);
						 		$("#summaterialfee").html(ll);
						 		
						 		var d=0;
					 		   	d=$("#sumlossfee").html();
								 var lll=toPrice(d,2);
						 		$("#sumlossfee").html(lll);
						 		
						 		var e=0
						 		e=$("#sumRemnant").html();
								 var ee=toPrice(e,2);
						 		$("#sumRemnant").html(ee);
						 	
		 		        });
				 </script>
				
			</table>
 </body>
 </html>
